﻿<%@ Page Language="C#" MasterPageFile="~/Design/MasterPage/MasterPage.master" AutoEventWireup="true"
    CodeFile="PersonJobSrhForm.aspx.cs" Inherits="App_Input_PersonJobSrhForm" Title="职位信息列表" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="javascript">
        function selectJob(id,name){
         var obj1 = opener.window.document.getElementById('<%=Request.QueryString["CONTROL_ID"]%>');
         var obj2 = opener.window.document.getElementById('<%=Request.QueryString["CONTROL_NAME"]%>');
         if(obj1!=null){
            obj1.value=id;
         } if(obj2!=null){
            obj2.value=name;
         }

        window.close();
    }
    
        function jobIdChange(object)
    {
     CommonAjaxUtils.FindPositions(object.value,get_jobId_Result_CallBack);

    }
    
     function get_jobId_Result_CallBack(response)
    {
        if (response.value != null)
        {                    

            var drop = window.document.getElementById('<%=lstJob.ClientID %>');
            drop.length=0;　　　　            
            var ds = response.value;
            if(ds != null && typeof(ds) == "object")
            {                   
　　                drop.options.add(new Option("",""));
                for(var i=0; i<ds.length; i++)
                {
       
　　                var name=ds[i].JobName;
　　                var id=ds[i].JobId;
　　                drop.options.add(new Option(name,id));
                }                
            }
        }
        return
    }
    </script>

    <div id="tableResult">
        <table width="100%">
            <tr>
                <td>
                    <table class="table_border_line">
                        <tr>
                            <td align="left" colspan="4">

                                <script language="javascript">
                                        (new TitleBar('SearchBar', '检索条件')).showBar();
                                </script>

                            </td>
                        </tr>
                    </table>
                    <table class="table_border_line">
                        <tr>
                            <td style="width: 16px; height: 26px;">
                                &nbsp;</td>
                            <td style="width: 120px; white-space: nowrap; height: 26px;" align="left">
                                部门信息</td>
                            <td align="left" style="height: 26px">
                                &nbsp;<asp:DropDownList ID="lstGroup" runat="server" DataTextField="departName" DataValueField="departId"
                                    onchange="jobIdChange(this)">
                                </asp:DropDownList></td>
                            <td align="right" style="height: 26px">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="width: 16px; height: 26px;">
                                &nbsp;</td>
                            <td style="width: 120px; white-space: nowrap; height: 26px;" align="left">
                                职位信息</td>
                            <td align="left" style="height: 26px">
                                &nbsp;<asp:DropDownList ID="lstJob" runat="server" DataTextField="JobName" DataValueField="JobId">
                                </asp:DropDownList></td>
                            <td align="right" style="height: 26px">
                                &nbsp;</td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <br />
                    <table>
                        <tr>
                            <td style="width: 80px; height: 24px;">
                                <asp:Button ID="btnSeach" runat="server" CssClass="button" Text="检 索" Width="100%"
                                    OnClick="btnSeach_Click" /></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <table width="100%">
            <tr>
                <td align="left">

                    <script language="javascript">
                                        (new TitleBar('SearchBar', '职位信息列表')).showBar();
                    </script>

                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="viewSrhRst" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        CssClass="GridView_table" DataKeyNames="JobId" OnPageIndexChanging="viewSrhRst_PageIndexChanging"
                        OnRowDataBound="viewSrhRst_RowDataBound" BorderStyle="Solid" BorderWidth="3px"
                        EnableViewState="true">
                        <Columns>
                            <asp:TemplateField HeaderText="选择" ShowHeader="False">
                                <ItemStyle CssClass="GridView_item_center" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <HeaderStyle CssClass="GridView_head_grayblue" width="10%"/>
                                <ItemTemplate>
                                    <asp:ImageButton ID="selectImg" runat="server" CausesValidation="False" CommandName="Select"
                                        ImageUrl="~/images/info.gif" Text="" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="职位编号" DataField="JobId" Visible="False">
                                <HeaderStyle Width="10%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="所属部门" DataField="DepartName">
                                <HeaderStyle Width="15%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="职位名称" DataField="JobName">
                                <HeaderStyle Width="15%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="隶属公司" DataField="JobCorp">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle Width="15%" CssClass="GridView_head_grayblue" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="直属上级" DataField="Superior">
                                <ItemStyle CssClass="GridView_item_left" />
                                <HeaderStyle Width="15%" CssClass="GridView_head_grayblue" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="直接下属" DataField="JobUnderLine">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle Width="15%" CssClass="GridView_head_grayblue" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="职位数" DataField="JobQuantity">
                                <HeaderStyle Width="10%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_left" />
                            </asp:BoundField>
                        </Columns>
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle HorizontalAlign="Right" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
